@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css");
.avatar-editor-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f6f7ff 0%, #fff 100%);
  padding: 20px;
}

.nav-bar {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.back-btn {
  display: flex;
  align-items: center;
  color: #7B68EE;
  font-size: 28rpx;
}

.title {
  font-size: 36rpx;
  font-weight: bold;
  color: #2C3E50;
  margin-left: 30px;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 15px;
}

.left-section {
  width: 100%;
  display: flex;
  gap: 10px;
}

.preview-section {
  flex: 1;
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.canvas-container {
  width: 240px;
  height: 240px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  font-size: 24rpx;
  font-weight: 600;
  transition: all 0.3s;
}

.action-btn.random {
  background: #98FB98;
  color: #2C3E50;
}

.action-btn.save {
  background: #7B68EE;
  color: white;
}

.colors-section {
  flex: 1;
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.color-group {
  margin-bottom: 20px;
}

.color-group:last-child {
  margin-bottom: 0;
}

.group-title {
  font-size: 26rpx;
  font-weight: 600;
  color: #2C3E50;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
}

.group-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: #7B68EE;
  border-radius: 2px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.right-section {
  width: 100%;
  background: white;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.control-group {
  margin-bottom: 16px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  height: 90px;
  border-radius: 8px;
  font-size: 24rpx;
  background: #f8f9fa;
  color: #2C3E50;
  transition: all 0.3s;
  text-align: center;
  min-width: 0;
  border: 1px solid #eee;
}

.style-btn.active {
  background: #7B68EE;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(123,104,238,0.2);
  border-color: #7B68EE;
}

.style-btn .fa {
  font-size: 24rpx;
  margin-bottom: 2px;
}

.style-btn .fa-user,
.style-btn .fa-eye,
.style-btn .fa-smile-o,
.style-btn .fa-graduation-cap {
  font-size: 20rpx;
  line-height: 1;
  margin-bottom: 4px;
}

.style-btn text {
  font-size: 22rpx;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

@media screen and (min-width: 768px) {
  .main-content {
    flex-direction: row;
  }
  
  .left-section {
    width: 300px;
    flex-direction: column;
  }
  
  .right-section {
    flex: 1;
  }
}

/* 弹窗样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 80%;
  max-width: 300px;
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

.modal-title {
  font-size: 32rpx;
  font-weight: 600;
  color: #2C3E50;
  text-align: center;
  margin-bottom: 24px;
}

.modal-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: 12px;
  font-size: 28rpx;
  background: #f8f9fa;
  color: #2C3E50;
  transition: all 0.3s;
  border: 1px solid #eee;
}

.modal-btn.primary {
  background: #7B68EE;
  color: white;
  border: none;
}

.modal-btn:active {
  transform: scale(0.98);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f8f9fa;
  color: #2C3E50;
  font-size: 24rpx;
  border: none;
}

.modal-close:active {
  background: #eee;
}

.avatar-editor-container.mobile {
  padding: 10px;
}
.mobile .editor-layout {
  flex-direction: column;
}
.mobile .avatar-preview {
  width: 100%;
  margin-bottom: 20px;
}
.mobile .config-panel {
  width: 100%;
}
.mobile .option-grid {
  grid-template-columns: repeat(3, 1fr);
} 